package com.tz.service.impl;

import com.tz.dao.IBookDao;
import com.tz.entity.Book;
import com.tz.entity.Category;
import com.tz.entity.Page;
import com.tz.service.IBookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * Created by heziqian on 2016/10/21.
 */
@Component
public class BookServiceImpl implements IBookService {

	@Autowired
	private IBookDao bookDao;
	
	@Override
	public Page findBookByPage(String cateId, int pageNow, int pageSize) {
		
		return bookDao.selectBookByPage(cateId, pageNow, pageSize);
	}

	@Override
	public Book findBookById(long bookId) {
		
		return bookDao.selectBookById(bookId);
	}

	@Override
	public Category findBookCategoryById(String cateId) {
		
		return bookDao.selectBookCategoryById(cateId);
	}

	@Override
	public List<Category> findAllBookCategory() {
		
		return bookDao.selectAllBookCategory();
	}

	@Override
	public Page findBookBystate(String state, int pageNow, int pageSize) {
		
		return bookDao.selectBookBystate(state, pageNow, pageSize);
	}

}
